//
//  HHLanguageService.h
//  ZHToolsKit
//
//  Created by chun.chen on 2020/3/23.
//  语言服务

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

// 用户选择的语言
static NSString *const kHHLanguage_userLanguageKey = @"zhUserLanguage";
// 系统默认语言
static NSString *const kHHLanguage_systemLanguageKey = @"AppleLanguages";

// 语言环境
typedef NS_ENUM (NSInteger, HHLanguageEnv) {
    /// 中文
    HHLanguageEnv_ZH,
    /// 英文
    HHLanguageEnv_EN
};

/// 语言切换委托
@protocol HHLanguageDelegate <NSObject>
@optional

/// 语言切换
/// @param language 切换的语言
- (void)hh_languageDidChange:(HHLanguageEnv)language;

@end

@interface HHLanguageService : NSObject

/// 单例服务
+ (instancetype)service;

/// 初始配置
- (void)hh_setup;

/// 当前语言
- (HHLanguageEnv)hh_language;
/// 当前服务器语言
- (NSString *)hh_serviceLanguage;
/// web 语言
- (NSString *)hh_webLanguage;

/// 切换语言
/// @param language 切换之后的语言
- (void)hh_changeLanguage:(HHLanguageEnv)language;

@end

NS_ASSUME_NONNULL_END
